<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        <p>组件传值的前提是父组件和子组件都存在</p>
        <p>父传子--父组件中的数据要传给子组件</p>
        <son
            :info1="msg1"
            :info2="msg2"
            :info3="msg3"
        ></son>
    </div>
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                msg1: '儿寒乎？欲食乎？',
                msg2: [1,2,3,4],
                msg3: {
                    name: 'jack',
                    age: 18
                }
            },
            methods: {
                
            },
            components: {
                'son': {
                    template: `<div class="son">我是子组件---{{info1}},{{info2.length}}-{{info3.age}}</div>`,
                    props: ['info1', 'info2', 'info3'],
                }
            }
        })
    </script>
</body>
</html>